import React, { Component } from "react";
import { Row, Col, Button } from "antd";
import styles from "./Top.less";

class Top extends Component {
  constructor(props) {
    super(props);
    this.state = {
      visible: props.visible,
    };
  }

  handleAddUser = () => {
    // const { visible = false, handleAdd = () => {} } = this.props;
    // handleAdd(!visible);
    this.props.update();
  };

  render() {
    // const { hasUpdata } = this.props;
    return (
      <Row className={styles.root}>
        <Col span={24} style={{ textAlign: "right" }}>
          {/* {hasUpdata ? (
            <Button
              type="primary"
              style={{ marginRight: 8 }}
              onClick={this.handleAddUser}
            >
              一键更新
            </Button>
          ) : null}  */}
          <Button
            onClick={this.props.idaasDataSync}
            style={{
              marginRight: 12,
            }}
          >
            4A数据同步
          </Button>
          {/* <Button onClick={this.props.showModal}>批量更新</Button> */}
        </Col>

        {/* <Col span={10} style={{ textAlign: "right" }}>
          <Search
            placeholder="请输入姓名"
            onSearch={changeName}
            style={{ width: 180, marginRight: 8 }}
          />
          <Search
            placeholder="请输入警号"
            onSearch={changePoliceId}
            style={{ width: 180 }}
          />
        </Col> */}
      </Row>
    );
  }
}

export default Top;
